package com.letoken.platform.app.job;


import com.letoken.platform.repo.app.dao.RedEnvelopesMapper;
import com.letoken.platform.repo.app.dao.RedEnvelopeMoneysMapper;
import com.letoken.platform.repo.app.po.RedEnvelope;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;


@Deprecated
//@Component
@Slf4j
public class RedEnvelopeJob {


    @Resource
    private RedEnvelopesMapper redEnvelopesMapper;

    @Resource
    private RedEnvelopeMoneysMapper redEnvelopeMoneysMapper;


    @XxlJob("RedEnvelopeReturn")
    public void redEnvelopeReturn(){
        List<RedEnvelope> redEnvelopes = redEnvelopesMapper.selectAvailable();
        LocalDateTime localDateTime =  LocalDateTime.now();
        for (RedEnvelope redEnvelope : redEnvelopes){
            redEnvelopeMoneysMapper.selectAvailable(redEnvelope.getId());
        }
    }

}
